package com.gaolu.test;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.gaolu.dao.CustomerDao;
import com.gaolu.model.Customer;

public class App {
	public static void main(String[] args) {
		ApplicationContext context = new ClassPathXmlApplicationContext("Spring-Module.xml");
		
		CustomerDao customerDao = (CustomerDao) context.getBean("customerDao");
		Customer customer = new Customer();
		customer.setCustId(1);
		customer.setName("gaolu");
		customer.setAge(27);
		customerDao.insert(customer);
		
		Customer sqlCustomer = customerDao.findByCustomerId(1);
		System.out.println(sqlCustomer);
	}
}
